package com.lagou;

import com.lagou.service.IUserService;
import com.lagou.service.UserServiceImpl;
import io.netty.bootstrap.ServerBootstrap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Component;


@Component
@SpringBootApplication
public class ServerBoot implements CommandLineRunner {

    @Autowired
    private UserServiceImpl userService;

    public static void main(String[] args) {
        //启动服务器
        SpringApplication.run(ServerBoot.class, args);
    }

    public void run(String... args) throws Exception {
        userService.startServer("127.0.0.1",8999);
    }
}
